<?php

class COOKIE {
	const USER_SECRET_KEY 	= "USER_SECRET_KEY";
	const USER_ID 			= "USER_ID";
	const LOCAL_OPEN_ID 	= "LOCAL_OPEN_ID";				//第一次从号上传过来的微信ID
	const REAL_LOC_OPEN_ID 	= "REAL_LOCAL_OPEN_ID";			//服务号关联的微信ID
	const LAST_LOGIN_TIME 	= "LAST_LOGIN_TIME";
	const COOKIE_TIME_ONE_YEAR = 31536000;	//一年
}

class YES_OR_NO {
	const YES 	= 1;
	const NO	= 0;
}

class STATUS {
	const DELETE = "-1";
	const VALID = "1";
	const INVALID = "0";

	public static function getStatusName($status) {
		switch ($status) {
			case STATUS::DELETE:
				return "已删除";
				break;

			case STATUS::VALID:
				return "有效";
				break;

			case STATUS::INVALID:
				return "无效";
				break;

			default :
				return "";
				break;
		}
	}
}

class GENDER {

	const MALE		 		= 1;
	const FEMALE		 	= 2;

	public static function getList() {
		$array[GENDER::MALE] 		= "男";
		$array[GENDER::FEMALE]		= "女";

		return $array;
	}

	public static function getName($data) {
		if($data == GENDER::MALE) {
			return "男";
		} else if ($data == GENDER::FEMALE) {
			return "女";
		}
	}
}

class ORDER_STATUS {
	const NEW_ORDER = "0";
	const PAYED_ORDER = "1";
	const CHONGING = "2";
	const FINISHED = "9";
	const FAIL = "11";
	
	public static function getOrderStatusName($status) {
		switch ($status) {
			case ORDER_STATUS::NEW_ORDER:
				return "未支付";
				break;

			case ORDER_STATUS::PAYED_ORDER:
				return "已支付";
				break;

			case ORDER_STATUS::CHONGING:
				return "充值中";
				break;
				
			case ORDER_STATUS::FINISHED:
				return "已完成";
				break;

			case ORDER_STATUS::FAIL:
				return "充值失败";
				break;
		}
	}
}

class POINT_TYPE {
	const SIGN 	= "sg";
	const WEB_TRAFFIC 	= "wt";
	const EXCHANGE 	= "ec";
	
	public static function getTypeName($type) {
		switch ($type) {
			case POINT_TYPE::SIGN:
				return "签到";
				break;

			case POINT_TYPE::WEB_TRAFFIC:
				return "流量兑换";
				break;

			case POINT_TYPE::EXCHANGE:
				return "积分兑换";
				break;
		}
	}
}
class PATH {
	const NO_IMAGE_PNG 	= "images/no_image.jpg";
	const LOG_4_PHP		= "/mnt/www/mbWebTraffic/config/log4php.properties";
}

class USE_RANGE {
	const COUNTRY 	= "0";
	const PROVINCE 	= "1";

	public static function getRangeName($range) {
		switch ($range) {
			case USE_RANGE::PROVINCE:
				return "省内";
				break;
			default :
				return "全国";
				break;
		}
	}
}

class MOBILE_TYPE {
	const YIDONG 	= "0";
	const LIANTONG 	= "1";
	const DIANXIN 	= "2";
	
	public static function getTypeName($type) {
		switch ($type) {
			case MOBILE_TYPE::LIANTONG:
				return "联通";
				break;
			case MOBILE_TYPE::DIANXIN:
				return "电信";
				break;
			default :
				return "移动";
				break;
		}
	}
}

class MAI_STATUS_CODE {
	public static $STATUS_CODE_ARRAY = array(
		"0000" => "订单提交成功",
		"1000" => "订单提交失败，充值失败",
		"1001" => "订单提交失败，充值的手机号码为空",
		"1002" => "订单提交失败，充值的手机号码不正确或不支持",
		"1003" => "订单提交失败，订单号为空",
		"1004" => "订单提交失败，订单号超出最大长度（30位）",
		"1005" => "订单提交失败，回调地址为空",
		"1006" => "订单提交失败，充值面值格式不正确",
		"1007" => "订单提交失败，充值类型不正确",
		"1008" => "订单提交失败，订单重复",
		"1009" => "订单提交失败，无法创建订单",
		"1010" => "订单提交失败，手机号码查询区域为空",
		"1011" => "订单提交失败，账户余额不足",
		"1012" => "订单提交失败，扣款失败",
		"1013" => "订单提交失败，退款失败",
		"1014" => "订单提交失败，退款成功",
		"1015" => "订单提交失败，所充值的产品不存在",
		"1016" => "订单提交失败，所充值的产品没有报价信息",
		"1017" => "订单提交失败，请求参数不完整",
		"1018" => "订单提交失败，充值渠道暂不可用",
		"1019" => "订单提交失败，流量包可充值范围为空",
		"1020" => "订单提交失败，没有可与充值范围匹配的流量包",
		"----" => "订单提交失败，原因不明"
	);
}

class MAI_CONNECT_CODE {
	public static $CONNECT_CODE_ARRAY = array(
			"200" => "请求成功",
			"500" => "请求失败，原因不明确",
			"406" => "系统当前处于维护中，请求拒绝",
			"900" => "没有权限",
			"3000" => "非法请求",
			"3001" => "请求内容为空",
			"3002" => "非法的token",
			"3003" => "非法的请求参数",
			"3004" => "非法的数字签名",
			"3005" => "非法的摘要",
			"3006" => "非法的开发者密钥",
			"3007" => "非法的数字签名密钥"
	);
}

?>